package chpt03;

public class ReferenceTest {
	public static void main(String[] args) {
		int x = 18;
		raiseID(x); // 基本数据类型作为方法参数
		System.out.println(x);
		
		Person p = new Person();
		p.id = 18;
		addPersonID(p); // 引用数据类型作为方法参数
		System.out.println(p.id);
	}
	public static void raiseID(int id) {
		id++;
	}
	public static void addPersonID(Person person) {
		person.id++;
		person = new Person(); //无法让main方法中的p改变指向
		person.id = 100;
	}
	public static void changePersonsID(Person[] persons) {
		//your code
	}
}
